home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
4490
/
4490.xpi
/
components
/
scripts
/
naver.js
< prev
next >
Wrap
Text File
|
2010-01-22
|
2KB
|
54 lines
/***********************************************************
naver
***********************************************************/
var hostString="";
var supportInboxOnly=true;
var supportShowFolders=true;
function init(){
this.dataURL="http://mail.naver.com";
this.loginData=["https://nid.naver.com/nidlogin.login",
"id","pw",
"url="+encodeURIComponent(this.dataURL)+"&cert=no&nomap=0&saveID=0&ssllogin=1"];
this.mailURL="http://mail.naver.com";
this.mailDomain="mail.naver.com";
}
function getData(aData){
var obj={};
this.folders={};//used for direct link
var re=/{\"FolderSN\":\"(\S+?)\",\"FolderType\":\"(.+?)\".+?\"FolderName\":\"(.+?)\",\"UnreadMailCount\":\"(\d+)\"/g;
var o;
var ar=[];
this.mailCount=0;
var found=false;
while ((o = re.exec(aData)) != null){
if(o[2]=="S"&&o[1]!="0")continue;
var found=true;
var n=parseInt(o[4]);
if(this.inboxOnly){
if(o[1]=="0")this.mailCount=n;
}else this.mailCount+=n;
if(n>0&&o[1]!="0"){
var name=unescape(o[3].replace(/\\/g,"%"));
this.folders[name]=o[1];
ar.push(name);
ar.push(n);
}
}
if(this.showFolders){
if(ar)obj.folders=encodeArray(ar);
}
if(!found)this.mailCount=-1;
return obj;
}
function getCount(aData){
return this.mailCount;
}
function getMailURL(aFolder){
if(this.dataURLCopy){
var url=this.dataURLCopy+"#"+encodeURIComponent("folderSN="+(aFolder?this.folders[aFolder]:0)+"÷=1&page=1&type=list");
return url;
}
return this.mailURL;
}